package com.lorenzogao.pley.bean

import io.reactivex.disposables.Disposable
import java.io.Serializable


/**
 * thumbnail : http://t1.market.xiaomi.com/thumbnail/
 * releaseKeyHash : be910af39a26a4a992c6fd01a143ed19
 * icon : AppStore/072725ca573700292b92e636ec126f51ba4429a50
 * apkHash : 010d7c92640b2e994839a81589d83bfa
 * appendExpansionPackSize : 0
 * hdIcon : {"main":"AppStore/07750d40a68e2445a3439a8f781083c431bfa5934"}
 * mainExpansionPackSize : 0
 * channelApkId : -1
 * fitness : 0
 * gamePackSize : 0
 * host : http://f6.market.xiaomi.com/download/
 * diffFileSize : 0
 * apkSize : 40309436
 * id : 1359
 * apk : AppStore/07650c4f6a86443a03920b69d83268aec54f00f5d
 * refPosition : -1
 */

data class AppDownloadInfo (var thumbnail: String,
                            var releaseKeyHash: String,
                            var icon: String,
                            var apkHash: String,
                            var appendExpansionPackSize: Int ,
                            var hdIcon: HdIconEntity,
                            var mainExpansionPackSize: Int ,
                            var channelApkId: Int ,
                            var fitness: Int,
                            var gamePackSize: Int ,
                            var host: String,
                            var diffFileSize: Int,
                            var apkSize: Int ,
                            var id: Int ,
                            var apk: String,
                            var refPosition: Int ,
                            var disposable: Disposable,
                            private var dowanloadUrl: String
): Serializable {




    val downloadUrl: String
        get() = if (dowanloadUrl != null) dowanloadUrl else this.host + this.apk

    fun setDowanloadUrl(dowanloadUrl: String) {
        this.dowanloadUrl = dowanloadUrl
    }

    inner class HdIconEntity : Serializable {
        /**
         * main : AppStore/07750d40a68e2445a3439a8f781083c431bfa5934
         */
        var main: String? = null
    }
}

